package DesignPattern;

public class Factory {
    public static void main(String[] args) {
        new ShapeFactory().getShape("Circle").draw();
    }
}

interface Shape {
    void draw();
}

class Circle implements Shape {

    @Override
    public void draw() {
        System.out.println("Circle");
    }
}

class Square implements Shape {

    @Override
    public void draw() {
        System.out.println("Square");
    }
}

class ShapeFactory{
    public Shape getShape(String shapeName){
        if(shapeName.equalsIgnoreCase("Circle")){
            return new Circle();
        }else{
            return new Square();
        }
    }
}
